//
//  UITextField+DFShake.h
//  FrameWork
//
//  Created by 王*风 on ****/5/9.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, JKShakedDirection) {
    JKShakedDirectionHorizontal,
    JKShakedDirectionVertical
};



@interface UITextField (DFShake)

//默认
- (void)df_shake;

/**
 times:摇晃的次数
 delta:震动的宽度
 */
- (void)df_shake:(int)times withDelta:(CGFloat)delta;


- (void)df_shake:(int)times withDelta:(CGFloat)delta completion:(void((^)(void)))handler;

/**
 times:摇晃的次数
 delta:震动的宽度
 interval:一次震动的持续时间
 */
- (void)df_shake:(int)times withDelta:(CGFloat)delta speed:(NSTimeInterval)interval;

- (void)df_shake:(int)times withDelta:(CGFloat)delta speed:(NSTimeInterval)interval completion:(void((^)(void)))handler;

/**
 times:摇晃的次数
 delta:震动的宽度
 interval:一次震动的持续时间
 shakeDirection:震动的方向
 */
- (void)df_shake:(int)times withDelta:(CGFloat)delta speed:(NSTimeInterval)interval shakeDirection:(JKShakedDirection)shakeDirection;

- (void)df_shake:(int)times withDelta:(CGFloat)delta speed:(NSTimeInterval)interval shakeDirection:(JKShakedDirection)shakeDirection completion:(void((^)(void)))handler;
@end

NS_ASSUME_NONNULL_END
